﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DomainModel;
using Utils;
using WebUI.Utils;

namespace WebUI.Models
{
    public class BillingInfoViewModel : BaseViewModel
    {
        public BillingInfoViewModel() : base()
        { }

        public Co Co { get; set; }
        public List<BillingInfo> BillingInfoList { get; set; }

        public string AvatarUrl { get; set; }

        protected override void SetVars()
        {
            Co = DataUtils.GetOne<Co>(ConstUtils.SP_GetCo, new { LoginID = Identity.LoginID, CoID = Identity.AccountID });
            BillingInfoList = DataUtils.GetList<BillingInfo>(ConstUtils.SP_GetBillingInfoByLoginID, new { LoginID = Identity.LoginID });

            AvatarUrl = ImageUtils.GetAvatarRelativeUrl(AvatarType.CoAvatar, Co.CoID, AvatarSizeEnum.Avatar_80x80, Co.AvatarFileExtension);
        }
    }
}